Lap Timer


Electronics Design Project

Requirements

Design an embedded microcontroller system to measure the lap and sector times of racecar with millisecond precision, and send data to OLED.
Design a case that protects PCB and connectors.

System Overview

Lap timing is an essential part of motorsports testing as it provides an objective measure of vehicle performance. Until last season, we relied on handheld stopwatches, which introduced approximately 0.15 to 0.30s of human reaction error. While this may seem inconsequential, it is important to note that the setup changes are small tweaks of a fraction of an angle, so we couldn't really tell if the car got faster by our adjustments. I've come up with a concept for a lap timer that removes the human factor by using an IR emitter/receiver to generate a pulse as the car crosses a checkpoint. The microcontroller timestamps those edges to compute sector and lap times.

Lap Timer Concept


Lay a narrow strip of retroreflective tape perpendicularly to the car's path. The IR LED points down and stays on continuously. Retroreflective tape would reflect IR beam back towards the co-located phototransistor, so the receiver only gets a strong signal while directly over the tape. Record the time that these events happen. Subtract the consecutive times to get sectr/lap times.

The goal is to have the microcontroller send lap and sector times over the CAN sensor bus into our already existing telemetry system, but for now, I want to verify if this solution is feasible before designing a more robust system. Some of the tests that I'd like to run are detection reliability, working gap between sensor and reflective surface, responses to ambient light

Design

Below is a functional block diagram for the system.



When the phototransistor detects the IR beam, it conducts more current, causing its output voltage to drop. During signal processing, a comparator compares the receiver output to a fixed threshold and drives HIGH when it falls below. The edge goes to a microcontroller interrupt, which immediately timestamps. Subtracting consecutibe timestamps gives the sector time.

The MCU then sends the numbers to the OLED over I2C. I2C is a serial communication protocal using two wires SDA (Serial Data) and SCL (Serial Clock), to connect multiple electronic components within a system.

Schematic

Components: